/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import javax.swing.JOptionPane;

/**
 *
 * @author server-data
 */
public class MenuPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form MenuPrincipal
     */
    
    /*
     Variables generales para el control del aplicativo
     */
    private String rol;
    
    public MenuPrincipal() {
        initComponents();
        
    }
    public void setRol(String rol){
        this.rol=rol;
        setMenusAvilitados();
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        Inicio = new javax.swing.JMenu();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        salir = new javax.swing.JMenuItem();
        Solicitudes = new javax.swing.JMenu();
        agregarSolicitud = new javax.swing.JMenuItem();
        jSeparator13 = new javax.swing.JPopupMenu.Separator();
        verSolicitudes = new javax.swing.JMenuItem();
        jSeparator14 = new javax.swing.JPopupMenu.Separator();
        analizar = new javax.swing.JMenuItem();
        Ordenes = new javax.swing.JMenu();
        agregarOrden = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        verOrden = new javax.swing.JMenuItem();
        BancoDD = new javax.swing.JMenu();
        listarProductos = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JPopupMenu.Separator();
        listarProveedores = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        registrarEnBanco = new javax.swing.JMenuItem();
        Configuracion = new javax.swing.JMenu();
        configProveedor = new javax.swing.JMenu();
        configAgregarProveedor = new javax.swing.JMenuItem();
        jSeparator7 = new javax.swing.JPopupMenu.Separator();
        configEdicionProveedor = new javax.swing.JMenuItem();
        jSeparator5 = new javax.swing.JPopupMenu.Separator();
        configDependencia = new javax.swing.JMenu();
        configAgregarDependencia = new javax.swing.JMenuItem();
        jSeparator9 = new javax.swing.JPopupMenu.Separator();
        configEdicionDependencia = new javax.swing.JMenuItem();
        jSeparator6 = new javax.swing.JPopupMenu.Separator();
        configProducto = new javax.swing.JMenu();
        configAgregarProducto = new javax.swing.JMenuItem();
        jSeparator11 = new javax.swing.JPopupMenu.Separator();
        configEdicionProducto = new javax.swing.JMenuItem();
        jSeparator8 = new javax.swing.JPopupMenu.Separator();
        jMenu1 = new javax.swing.JMenu();
        registrarUsuario = new javax.swing.JMenuItem();
        jSeparator10 = new javax.swing.JPopupMenu.Separator();
        listarUsuarios = new javax.swing.JMenuItem();
        jSeparator12 = new javax.swing.JPopupMenu.Separator();
        cambiarPassword = new javax.swing.JMenuItem();
        Inventario = new javax.swing.JMenu();
        inv_actualizar = new javax.swing.JMenu();
        inv_importar = new javax.swing.JMenuItem();
        inv_ingresar = new javax.swing.JMenuItem();
        inv_listar = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Menú Principal");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        Inicio.setText("Inicio");
        Inicio.add(jSeparator1);

        salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.ALT_MASK));
        salir.setText("Salir");
        salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirActionPerformed(evt);
            }
        });
        Inicio.add(salir);

        jMenuBar1.add(Inicio);

        Solicitudes.setText("Solicitudes");
        Solicitudes.setEnabled(false);

        agregarSolicitud.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        agregarSolicitud.setText("Agregar Solicitud");
        agregarSolicitud.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                agregarSolicitudActionPerformed(evt);
            }
        });
        Solicitudes.add(agregarSolicitud);
        Solicitudes.add(jSeparator13);

        verSolicitudes.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        verSolicitudes.setText("Ver Solicitudes");
        verSolicitudes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verSolicitudesActionPerformed(evt);
            }
        });
        Solicitudes.add(verSolicitudes);
        Solicitudes.add(jSeparator14);

        analizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        analizar.setText("Analisar Solcitudes");
        analizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                analizarActionPerformed(evt);
            }
        });
        Solicitudes.add(analizar);

        jMenuBar1.add(Solicitudes);

        Ordenes.setText("Ordenes");
        Ordenes.setEnabled(false);

        agregarOrden.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK));
        agregarOrden.setText("Agregar Orden");
        agregarOrden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                agregarOrdenActionPerformed(evt);
            }
        });
        Ordenes.add(agregarOrden);
        Ordenes.add(jSeparator2);

        verOrden.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        verOrden.setText("Ver Ordenes");
        verOrden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verOrdenActionPerformed(evt);
            }
        });
        Ordenes.add(verOrden);

        jMenuBar1.add(Ordenes);

        BancoDD.setText("Banco de Datos");
        BancoDD.setEnabled(false);

        listarProductos.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        listarProductos.setText("Listar Productos");
        listarProductos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listarProductosActionPerformed(evt);
            }
        });
        BancoDD.add(listarProductos);
        BancoDD.add(jSeparator4);

        listarProveedores.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        listarProveedores.setText("Listar Proveedores");
        listarProveedores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listarProveedoresActionPerformed(evt);
            }
        });
        BancoDD.add(listarProveedores);
        BancoDD.add(jSeparator3);

        registrarEnBanco.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));
        registrarEnBanco.setText("Registrar en Banco");
        registrarEnBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                registrarEnBancoActionPerformed(evt);
            }
        });
        BancoDD.add(registrarEnBanco);

        jMenuBar1.add(BancoDD);

        Configuracion.setText("Configuración");
        Configuracion.setEnabled(false);

        configProveedor.setText("Proveedores");

        configAgregarProveedor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        configAgregarProveedor.setText("Agregar Proveedor");
        configAgregarProveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configAgregarProveedorActionPerformed(evt);
            }
        });
        configProveedor.add(configAgregarProveedor);
        configProveedor.add(jSeparator7);

        configEdicionProveedor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        configEdicionProveedor.setText("Edición");
        configEdicionProveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configEdicionProveedorActionPerformed(evt);
            }
        });
        configProveedor.add(configEdicionProveedor);

        Configuracion.add(configProveedor);
        Configuracion.add(jSeparator5);

        configDependencia.setText("Dependencias");

        configAgregarDependencia.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        configAgregarDependencia.setText("Agregar Dependencia");
        configAgregarDependencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configAgregarDependenciaActionPerformed(evt);
            }
        });
        configDependencia.add(configAgregarDependencia);
        configDependencia.add(jSeparator9);

        configEdicionDependencia.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
        configEdicionDependencia.setText("Edición");
        configEdicionDependencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configEdicionDependenciaActionPerformed(evt);
            }
        });
        configDependencia.add(configEdicionDependencia);

        Configuracion.add(configDependencia);
        Configuracion.add(jSeparator6);

        configProducto.setText("Productos");

        configAgregarProducto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        configAgregarProducto.setText("Agregar Producto");
        configAgregarProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configAgregarProductoActionPerformed(evt);
            }
        });
        configProducto.add(configAgregarProducto);
        configProducto.add(jSeparator11);

        configEdicionProducto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
        configEdicionProducto.setText("Edición");
        configEdicionProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configEdicionProductoActionPerformed(evt);
            }
        });
        configProducto.add(configEdicionProducto);

        Configuracion.add(configProducto);
        Configuracion.add(jSeparator8);

        jMenu1.setText("Usuarios");

        registrarUsuario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));
        registrarUsuario.setText("Registrar Usuario");
        registrarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                registrarUsuarioActionPerformed(evt);
            }
        });
        jMenu1.add(registrarUsuario);
        jMenu1.add(jSeparator10);

        listarUsuarios.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));
        listarUsuarios.setText("Listar Usuarios");
        listarUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listarUsuariosActionPerformed(evt);
            }
        });
        jMenu1.add(listarUsuarios);
        jMenu1.add(jSeparator12);

        cambiarPassword.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        cambiarPassword.setText("Cambiar mi Contraseña");
        cambiarPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cambiarPasswordActionPerformed(evt);
            }
        });
        jMenu1.add(cambiarPassword);

        Configuracion.add(jMenu1);

        jMenuBar1.add(Configuracion);

        Inventario.setText("Inventario");
        Inventario.setEnabled(false);

        inv_actualizar.setText("Actualizar");

        inv_importar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
        inv_importar.setText("Importar Lista");
        inv_importar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inv_importarActionPerformed(evt);
            }
        });
        inv_actualizar.add(inv_importar);

        inv_ingresar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
        inv_ingresar.setText("Ingresar Producto");
        inv_ingresar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inv_ingresarActionPerformed(evt);
            }
        });
        inv_actualizar.add(inv_ingresar);

        Inventario.add(inv_actualizar);

        inv_listar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.ALT_MASK));
        inv_listar.setText("Listar");
        inv_listar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inv_listarActionPerformed(evt);
            }
        });
        Inventario.add(inv_listar);

        jMenuBar1.add(Inventario);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 684, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 393, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void listarProductosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listarProductosActionPerformed
        // TODO add your handling code here:
        ListarProductos lp = new ListarProductos();
        lp.setVisible(true);
    }//GEN-LAST:event_listarProductosActionPerformed

    private void listarProveedoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listarProveedoresActionPerformed
        // TODO add your handling code here:
        ListarProveedores lp = new ListarProveedores();
        lp.setVisible(true);
    }//GEN-LAST:event_listarProveedoresActionPerformed

    private void salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Esta Seguro que Desea Salir del Sistema","Saliendo",2)==0){
            System.exit(0);
        }
    }//GEN-LAST:event_salirActionPerformed

    private void agregarOrdenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agregarOrdenActionPerformed
        // TODO add your handling code here:
        AgregarOrden ag = new AgregarOrden();
        ag.setVisible(true);
    }//GEN-LAST:event_agregarOrdenActionPerformed

    private void verOrdenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verOrdenActionPerformed
        // TODO add your handling code here:
        VerOrdenes vo = new VerOrdenes();
        vo.setVisible(true);
    }//GEN-LAST:event_verOrdenActionPerformed

    private void agregarSolicitudActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agregarSolicitudActionPerformed
        // TODO add your handling code here:
        AgregarSolicitud as = new AgregarSolicitud();
        as.setVisible(true);
    }//GEN-LAST:event_agregarSolicitudActionPerformed

    private void verSolicitudesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verSolicitudesActionPerformed
        // TODO add your handling code here:
        VerSolicitudes vs = new VerSolicitudes();
        vs.setVisible(true);
    }//GEN-LAST:event_verSolicitudesActionPerformed

    private void configEdicionProveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configEdicionProveedorActionPerformed
        // TODO add your handling code here:
        ListarProveedoresEdicion pd = new ListarProveedoresEdicion();
        pd.llenarDatos();
        pd.setVisible(true);
    }//GEN-LAST:event_configEdicionProveedorActionPerformed

    private void configAgregarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configAgregarProductoActionPerformed
        // TODO add your handling code here:
        AgregarProducto ap = new AgregarProducto();
        ap.setVisible(true);
    }//GEN-LAST:event_configAgregarProductoActionPerformed

    private void configAgregarDependenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configAgregarDependenciaActionPerformed
        // TODO add your handling code here:
        AgregarDependencia ad = new AgregarDependencia();
        ad.setVisible(true);
    }//GEN-LAST:event_configAgregarDependenciaActionPerformed

    private void configAgregarProveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configAgregarProveedorActionPerformed
        // TODO add your handling code here:
        AgregarProveedor ap = new AgregarProveedor();
        ap.setVisible(true);
    }//GEN-LAST:event_configAgregarProveedorActionPerformed

    private void configEdicionDependenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configEdicionDependenciaActionPerformed
        // TODO add your handling code here:
        ListarDependenicasEdicion lde = new ListarDependenicasEdicion();
        lde.llenarTabla();
        lde.setVisible(true);
    }//GEN-LAST:event_configEdicionDependenciaActionPerformed

    private void configEdicionProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configEdicionProductoActionPerformed
        // TODO add your handling code here:
        ListarProductosEdicion lpe = new ListarProductosEdicion();
        lpe.llenartabla();
        lpe.setVisible(true);
    }//GEN-LAST:event_configEdicionProductoActionPerformed

    private void registrarEnBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrarEnBancoActionPerformed
        // TODO add your handling code here:
        AgregarProductoBanco ap = new AgregarProductoBanco();
        ap.setVisible(true);
    }//GEN-LAST:event_registrarEnBancoActionPerformed

    private void registrarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrarUsuarioActionPerformed
        // TODO add your handling code here:
        NuevoUsuario nu = new NuevoUsuario();
        nu.setVisible(true);
    }//GEN-LAST:event_registrarUsuarioActionPerformed

    private void inv_importarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inv_importarActionPerformed
        // TODO add your handling code here:
        ImportarLista  il = new ImportarLista();
        il.setVisible(true);
    }//GEN-LAST:event_inv_importarActionPerformed

    private void listarUsuariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listarUsuariosActionPerformed
        // TODO add your handling code here:
        ListarUsuarios lu = new ListarUsuarios();
        lu.llenarTabla();
        lu.setVisible(true);
    }//GEN-LAST:event_listarUsuariosActionPerformed

    private void inv_ingresarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inv_ingresarActionPerformed
        // TODO add your handling code here:
        AgregarEntrada ae = new AgregarEntrada();
        ae.setVisible(true);
    }//GEN-LAST:event_inv_ingresarActionPerformed

    private void analizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_analizarActionPerformed
        // TODO add your handling code here:
        VerAnalisisSolicitudes va = new VerAnalisisSolicitudes();
        va.setVisible(true);
    }//GEN-LAST:event_analizarActionPerformed

    private void cambiarPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cambiarPasswordActionPerformed
        // TODO add your handling code here:
        CambiarPassword cp = new CambiarPassword();
        cp.setVisible(true);
    }//GEN-LAST:event_cambiarPasswordActionPerformed

    private void inv_listarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inv_listarActionPerformed
        // TODO add your handling code here:
        ListarInventario li = new ListarInventario();
        li.setVisible(true);
    }//GEN-LAST:event_inv_listarActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "esta Seguro que Desea Salir?")==0){
            System.exit(0);
        }
    }//GEN-LAST:event_formWindowClosing

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu BancoDD;
    private javax.swing.JMenu Configuracion;
    private javax.swing.JMenu Inicio;
    private javax.swing.JMenu Inventario;
    private javax.swing.JMenu Ordenes;
    private javax.swing.JMenu Solicitudes;
    private javax.swing.JMenuItem agregarOrden;
    private javax.swing.JMenuItem agregarSolicitud;
    private javax.swing.JMenuItem analizar;
    private javax.swing.JMenuItem cambiarPassword;
    private javax.swing.JMenuItem configAgregarDependencia;
    private javax.swing.JMenuItem configAgregarProducto;
    private javax.swing.JMenuItem configAgregarProveedor;
    private javax.swing.JMenu configDependencia;
    private javax.swing.JMenuItem configEdicionDependencia;
    private javax.swing.JMenuItem configEdicionProducto;
    private javax.swing.JMenuItem configEdicionProveedor;
    private javax.swing.JMenu configProducto;
    private javax.swing.JMenu configProveedor;
    private javax.swing.JMenu inv_actualizar;
    private javax.swing.JMenuItem inv_importar;
    private javax.swing.JMenuItem inv_ingresar;
    private javax.swing.JMenuItem inv_listar;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator10;
    private javax.swing.JPopupMenu.Separator jSeparator11;
    private javax.swing.JPopupMenu.Separator jSeparator12;
    private javax.swing.JPopupMenu.Separator jSeparator13;
    private javax.swing.JPopupMenu.Separator jSeparator14;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JPopupMenu.Separator jSeparator4;
    private javax.swing.JPopupMenu.Separator jSeparator5;
    private javax.swing.JPopupMenu.Separator jSeparator6;
    private javax.swing.JPopupMenu.Separator jSeparator7;
    private javax.swing.JPopupMenu.Separator jSeparator8;
    private javax.swing.JPopupMenu.Separator jSeparator9;
    private javax.swing.JMenuItem listarProductos;
    private javax.swing.JMenuItem listarProveedores;
    private javax.swing.JMenuItem listarUsuarios;
    private javax.swing.JMenuItem registrarEnBanco;
    private javax.swing.JMenuItem registrarUsuario;
    private javax.swing.JMenuItem salir;
    private javax.swing.JMenuItem verOrden;
    private javax.swing.JMenuItem verSolicitudes;
    // End of variables declaration//GEN-END:variables

    private void setMenusAvilitados() {
        if(rol.equalsIgnoreCase("Administrador")){
            Solicitudes.setEnabled(true);
            Ordenes.setEnabled(true);
            BancoDD.setEnabled(true);
            Configuracion.setEnabled(true);
            Inventario.setEnabled(true);
        }else if(rol.equalsIgnoreCase("General")){
            Solicitudes.setEnabled(true);
            verSolicitudes.setEnabled(false);
            BancoDD.setEnabled(true);
            registrarEnBanco.setEnabled(false);
            Configuracion.setEnabled(true);
            configDependencia.setEnabled(false);
            configProducto.setEnabled(false);
            configProveedor.setEnabled(false);
            listarUsuarios.setEnabled(false);        
            registrarUsuario.setEnabled(false);
            
        }else{
            JOptionPane.showMessageDialog(null, "Usted No tiene Permisos Para Ingresar al Sistema");
            System.exit(0);
        }
    }
}
